#include <iostream>
#include "LinkTree.h"

int main()
{
    LinkTree tree;

    TreeNode *class1 = new TreeNode("267班");
    TreeNode *class2 = new TreeNode("268班");

    class1->Connect(tree.GetRoot());
    class2->Connect(tree.GetRoot());

    TreeNode *stu1 = new TreeNode("张三");
    TreeNode *stu2 = new TreeNode("李四");
    TreeNode *stu3 = new TreeNode("王五");
    TreeNode *stu4 = new TreeNode("赵六");

    stu1->Connect(class1);
    stu2->Connect(class1);

    stu3->Connect(class2);
    stu4->Connect(class2);

    // tree.show();
    
    // TreeNode *node = tree.FindByElement("赵六");
    // node->DisConnect(tree.FindByElement("268班"));
    // node->Connect(tree.FindByElement("267班"));
    // tree.show();

    std::cout<<"树高："<<tree.GetTreeHeight()<<std::endl;


    return 0;
}